# coding=utf-8
# 模板实体解析


from i_entity_extractor.extractors.default.default_extractor import DefaultExtractor


class TemplateExtractor(DefaultExtractor):
    def __init__(self, topic_info, log):
        DefaultExtractor.__init__(self, topic_info, log)

    def entity_extract(self, parse_info, extract_data):
        '''模板实体解析入口'''
        extract_info = parse_info.extract_info
        url = parse_info.base_info.url
        self.log.info("template_start_parse\turl:%s\ttopic_id:%s" % (url, extract_info.topic_id))
        entity_data = self.format_extract_data(extract_data)

        return entity_data

    def format_extract_data(self, extract_data):
        '''实体解析抽取数据'''

        entity_data = {

        }
        return entity_data